//
//  KQMessageHouseKeeperContent.swift
//  KangYunYouJia
//
//  Created by zhouxiang on 2021/3/10.
//  Copyright © 2021 kqdc. All rights reserved.
//

import UIKit
import KakaJSON

class KQMessageHouseKeeperContent: NSObject, KQMessageContentType {

    required init(dataList: [KQMessageHouseKeeperModel]?) {
        super.init()
        self.dataList.removeAll()
        self.dataList.append(contentsOf: dataList ?? [])
        
    }
    
    var dataList: [KQMessageHouseKeeperModel] = []
    var title = "请选择您的专属管家"
    
    public weak var delegate: KQMessageDelegate?
    /// 这里left设置-5，是因为KQMessageStyle .custom方式会有 5的偏移量
    open var layoutMargins: UIEdgeInsets = UIEdgeInsets(top: 0, left: -5, bottom: 0, right: 0)
    
    open class var viewType: KQMessageContentViewType.Type {
        return KQMessageHouseKeeperContentView.self
    }
    
    open func sizeThatFits(_ size: CGSize) -> CGSize {
        let height = KQMessageHouseKeeperContentView.getTotalHeight(title: self.title, list: self.dataList)
        return CGSize(width: 250.0, height: height)
    }

}

class KQMessageHouseKeeperModel: NSObject, Convertible {
    
    required override init() {}
    /// 房产名称
    var houseName: String?
    /// 管家的用户id
    var userId: String?
    /// 管家名称
    var nickname: String?
    
}


